<%@ page language="java" pageEncoding="utf-8"%>
<%@ page import="com.roadmap.struts.action.PagingInfo"%>
<%@ page import="com.roadmap.struts.action.ActionConst"%>
<%
PagingInfo pagingInfo = (PagingInfo) request.getAttribute(ActionConst.PAGING_INFO_IN_REQUEST);
if (pagingInfo == null) {
	return;
}
String requestUrl = pagingInfo.getPreparedURL();
if(request == null) {
	return;
}
%>
     <div class="paging">  
         <% 
         	if(!pagingInfo.isOK()) {
         		return;
         	}
         	int current = pagingInfo.getCurrentPageNum();
         	int total = pagingInfo.getTotalPageCount();
         	out.println("<ul>");
         	
         	if (current > 1) {
         		out.println(String.format("<li><a href='%s%s'>首页</a></li>", requestUrl, 1));
         		out.println(String.format("<li><a href='%s%s'>上一页</a></li>", requestUrl, current - 1));
         	}
         	
         	for (int pn = pagingInfo.getFirstPageNum(); pn <= pagingInfo.getLastPageNum(); pn++) {
         		if(pn == current) {
         			out.println(String.format("<li><b>%s</b></li>", pn));
         		}
         		else {
         			out.println(String.format("<li><a href='%s%s'>%s</a></li>", requestUrl, pn, pn));
         		}
         	}
         		
         	if (current < total) {
         		out.println(String.format("<li><a href='%s%s'>下一页</a></li>", requestUrl, current + 1));
         		out.println(String.format("<li><a href='%s%s'>尾页</a></li>", requestUrl, total));
         	}
         	
         	out.println(String.format("<li><span>页数/结果数: %s/%s</span></li>", total, pagingInfo.getTotalResultCount()));
         	out.println("</ul>");
         %>  
     </div>  
